package com.dayu.tcp.protocol;

public class K1MessageStaticFactory {
    private K1MessageStaticFactory() {
    }

    public static Object k1MsgToMsg(K1BaseMessage k1BaseMessage) {
        if (k1BaseMessage == null) {
            return null;
        }
        final int messageType = k1BaseMessage.getMessageType();
        if (messageType == K1Protocol.MESSAGE_TYPE_RESTFUL_REQUEST) {
            return K1RestfulRequest.k1BaseMessageTORequest(k1BaseMessage);
        } else if (messageType == K1Protocol.MESSAGE_TYPE_RESTFUL_RESPONSE) {
            return K1RestfulResponse.k1BaseMessageTOResponse(k1BaseMessage);
        }
        return k1BaseMessage;
    }
}
